<?php
namespace Menu\Controller;
use Think\Controller;
class LoginController extends Controller {
	protected $DB;
	public function __construct(){
		parent::__construct();
		$this->DB = D('Users');
	}
	public function index(){
		// $this->redirect('/Menu/Index/index/',5, '页面跳转中...');
		layout(false);
		$this->display();
	}
	public function Add(){
		$data = $this->DB->userAdd();
	}
	public function login(){
		$data = $this->DB->userRead();
		if($data['info']){
			session('user_name',$data['user_name']);
			$this->success($data['info'],U('Index/index'));
		}else{
			$this->error('密码错误');
		}
	}
}